<template>
  <div id="app">
    
    <router-view/>
  </div>
</template>
<script>
import { mapMutations } from 'vuex'
export default{
  mounted:function(){
    let currentUser=JSON.parse(localStorage.getItem("currentUser"));
    // console.log(currentUser);
    if(currentUser!==null){
     this.init(currentUser)
    }else{
      this.$router.replace("/login") 
    }
  },
  methods:{
    ...mapMutations(["init"])
  }
}
</script>


<style lang="scss">
html,body{
   height: 100%;
 }
#app {
 height: 100%;
 
}
 *{
   margin: 0;
   padding: 0;
 }


</style>
